package com.faxsun.controller.catalog.domain;

import java.io.Serializable;

import com.faxsun.core.tool.MobilePhoneMask;

@SuppressWarnings("serial")
public class TreasureCustomer implements Serializable, Comparable<TreasureCustomer> {

	private String phone;
	private String date;
	private String time;
	
	public String getPhone() {
		if(phone != null && phone.length() == 11){
			return MobilePhoneMask.maskMobilePhone(phone);
		}		
		return phone;
	}
	public String getTime() {
		return time;
	}
	public void setTime(String time) {
		this.time = time;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getDate() {
		return date;
	}
	public void setDate(String date) {
		this.date = date;
	}
	
	@Override
	public int compareTo(TreasureCustomer o) {
		String time = this.getDate() + this.getTime();
		String otime = o.getDate() + o.getTime();
		return otime.compareTo(time);
	}
		
}
